package com.itheima.day04_array;

import java.util.Random;
import java.util.Scanner;

public class Demo13_suijiapaiming{
    public static void main(String[] args) {
        int[] code = new int[5];
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < code.length; i++) {
            System.out.println("请输入第" + (i + 1) + "号员工的工号：");
            code[i] = scanner.nextInt();
        }

        Random random = new Random();
        for (int i = 0; i < code.length; i++) {
            int index = random.nextInt(code.length);
            int temp = code[index];
            code[index] = code[i];
            code[i] = temp;
        }

        for (int i = 0; i < code.length; i++) {
            System.out.print(code[i] + " ");
        }
    }
}
